#pragma once


class CMILMatrix;

class HitTestPolygon
{
private: 
	HitTestPolygon(const HitTestPolygon &);
public: 
	HitTestPolygon();
	~HitTestPolygon();
	HRESULT SetRect(const struct XRECTF_WH & rect);
	HRESULT SetPoints(XUINT32 numPoints, const struct XPOINTF * pPoints);
	HRESULT SetEmpty();
	HRESULT CopyTo(HitTestPolygon * pDest);
	HRESULT UpdateStateFromPoints();
	HRESULT UpdateStateFromRect();
	HRESULT Transform(const CMILMatrix * pTransform, HitTestPolygon * pDest);
	HRESULT Transform(const CMILMatrix * pTransform);
	HRESULT IntersectsPolygon(XUINT32 numPoints, const struct XPOINTF * pPoints, XUINT32 * pIntersects);
	XUINT32 IntersectsRect(const struct XRECTF_RB & rect);
	XUINT32 IntersectsRect(const struct XRECTF_WH & rect);
	HRESULT ClipToPolygon(XUINT32 numPoints, const struct XPOINTF * pPoints);
	HRESULT ClipToRect(const struct XRECTF_WH & rect);
	struct XPOINTF * GetPoints();
	XUINT32 GetSize();
	XBOOL IsEmpty();
private: 
	HitTestPolygon & operator=(const HitTestPolygon & rhs);
	struct XRECTF_WH m_rect; 
	xvector<XPOINTF> m_points; 
	XBOOL m_isRect;

};